package com.woniu.userservice.dao;

import com.woniu.userservice.entity.Messages;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author dell
 */
public interface MessagesDao {
    Messages queryById(Integer id);

    List<Messages> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
    
    List<Messages> findAll();

    List<Messages> queryAll(Messages messages);

    int insert(Messages messages);

    int update(Messages messages);

    int deleteById(Integer id);

    //查询设置提醒的人数
    @Select("SELECT COUNT(DISTINCT userId) reminderpeople FROM messages WHERE goodsId=#{goodsid};")
    Integer selectReminderpeople(Integer goodsid);
}